[@com.header _title="用户管理"]
<link rel="stylesheet" href="${base}/res/plugins/iCheck/square/blue.css">
<link rel="stylesheet" href="${base}/res/components/bootstrapvalidator/dist/css/bootstrapValidator.css"/>
[/@com.header]
[@com.body]
<section class="content container-fluid">
    <div class="box box-info">
        <form id="form-user" class="form-horizontal" action="save" onsubmit="return false">
            <input type="hidden" name="id" value="${entity.id}" />
            <div class="box-header with-border">
                <button type="submit" class="btn btn-info"><i class="fa fa-save"></i> 保存</button>
                <a href="index" class="btn btn-default"><i class="fa fa-undo"></i> 返回</a>
            </div>
            <div class="box-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label">用户名</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="userName" id="userName" placeholder="请输入用户名" type="text"
                            required minlength="3" maxlength="20" value="${entity.userName}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">昵称</label>
                    <div class="col-sm-6">
                        <input class="form-control" name="nickName" id="nickName" placeholder="请输入昵称" type="text"
                            required maxlength="20" value="${entity.nickName}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">密码</label>
                    <div class="col-sm-4">
                        <input type="hidden" name="password" id="password" />
                        <input class="form-control" name="password1" id="password1" placeholder="请输入密码" type="password"
                            exclude data-bv-identical data-bv-identical-field="repeatPassword" data-bv-identical-message="密码不一致"
                            minlength="6"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">确认密码</label>
                    <div class="col-sm-4">
                        <input class="form-control" name="repeatPassword" id="repeatPassword" placeholder="请重新输入密码" type="password"
                            exclude data-bv-identical data-bv-identical-field="password1" data-bv-identical-message="密码不一致"
                            minlength="6"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">状态</label>
                    <div class="col-sm-6">
                        <div class="">
                            <label><input type="radio" name="status" value="1" [#if entity.status == 1]checked[/#if] required/> 启用</label>
                            <label><input type="radio" name="status" value="0" [#if entity.status == 0]checked[/#if] /> 禁用</label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">部门</label>
                    <div class="col-sm-4">
                        <input class="form-control" name="deptId" id="deptId" placeholder="请选择部门" type="text"
                            value="${entity.deptId}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">头像</label>
                    <div class="col-sm-4">
                        <input class="form-control" name="portrait" id="portrait" placeholder="请上传头像" type="text" value="${entity.portrait}"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">角色</label>
                    <div class="col-sm-10">
                        <div class="checkbox">
                            [#list roles as r]
                            <label><input type="checkbox" name="roleId" value="${r.id}" l-icheck ${(userRoles?seq_contains(r.id)?string("checked",""))!} /> ${r.roleName}</label>
                            [/#list]
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</section>
[/@com.body]
<script type="text/javascript" src="${base}/res/plugins/iCheck/icheck.min.js"></script>
<script type="text/javascript" src="${base}/res/components/bootstrapvalidator/dist/js/bootstrapValidator.js"></script>
<script type="text/javascript" src="${base}/res/components/bootstrapvalidator/dist/js/language/zh_CN.js"></script>
<script type="text/javascript" src="${base}/res/plugins/jquery.md5.min.js"></script>
<script type="text/javascript" src="${base}/res/js/system/user.js"></script>
